﻿#ifndef HNRJITCHECKBOX_H
#define HNRJITCHECKBOX_H

#include "HnrjitButton.h"

class DIRECTUI_API CHnrjitCheckBox : public CHnrjitButton
{
public:
	explicit CHnrjitCheckBox();

	/// <summary>获取当前类标识</summary>
	virtual DWORD GetClsid() const { return CLSID_HNRJITCHECKBOX; }

	/// <summary>设置属性值</summary>
	/// <param name="pxElement">XML元素</param>
	virtual void SetAttribute(const TiXmlElement* pxElement, HZIP hZipRes = NULL);

public:
	/// <summary>获取控件状态</summary>
	virtual ControlStatus GetControlState() const;

	/// <summary>复选框是否勾选</summary>
	virtual BOOL IsChecked() const;
	virtual void SetChecked(BOOL isChecked);

public:
	/// <summary>绘制复选框</summary>
	/// <param name="pDC">设备上下文</param>
	virtual void DrawControl(HDC hdc);

	/// <summary>鼠标按下事件</summary>
	/// <param name="nFlags">按下的键</param>
	/// <param name="point">鼠标位置</param>
	virtual void OnMousePress(UINT nFlags, CPoint point);

	/// <summary>鼠标释放事件</summary>
	/// <param name="nFlags">按下的键</param>
	/// <param name="point">鼠标位置</param>
	virtual void OnMouseRelease(UINT nFlags, CPoint point);

private:
	BOOL m_isChecked; // 复选框是否勾选
};

#endif // HNRJITCHECKBOX_H